Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Latest commit

 

History

History
14 lines (10 loc) · 514 Bytes

7.3.2 - Http/Response->cookie.md

File metadata and controls

14 lines (10 loc) · 514 Bytes

Http\Response->cookie

设置HTTP响应的cookie信息。此方法参数与PHPsetcookie完全一致。

function Http\Response->cookie(string $key, string $value = '', int $expire = 0 , string $path = '/', string $domain  = '', bool $secure = false , bool $httponly = false);

cookie设置必须在end方法之前

注意事项

  • 底层自动会对$value进行urlencode编码,可使用rawCookie关闭对$value的编码处理
  • 底层允许设置多个相同$keyCOOKIE